<template>
  <j-modal title="督办设置" :width="800" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk" v-if="data" :okText="data.supervisResult === 2 ? '确认' : '归档'">
    <div>
      <a-descriptions :column="1" layout="horizontal">
        <a-descriptions-item label="督办对象">
          {{ data.personnelName }}
        </a-descriptions-item>
        <a-descriptions-item label="手机号">
          {{ data.phone }}
        </a-descriptions-item>
        <a-descriptions-item label="所属区域">
          {{ data.region }}
        </a-descriptions-item>
        <a-descriptions-item label="事项详情">
          {{ data.materDatails }}
        </a-descriptions-item>
        <a-descriptions-item label="反馈说明">
          {{ data.feedback }}
        </a-descriptions-item>
        <a-descriptions-item label="附件">
          <a>{{ data.file }}</a>
        </a-descriptions-item>
      </a-descriptions>
    </div>
  </j-modal>
</template>
<script>
import {getSetId, putFile, saverSetup} from "@api/sjsk/specialist";

export default {
  name: 'AddModal',
  props:['data'],
  data() {
    return {
      visible: false,
      form: {},
      startValue: undefined,
    }
  },
  async created() {
  },
  methods: {
    show() {
      this.visible = true
      getSetId().then( res => {
        if(res.success){
          this.form = res.result
        }
      } )
    },
    onStartChange() {

    },
    onChange(e) {
      // if (e.target.value == '2') {
      //   this.isPositive = true
      // } else {
      //   this.isPositive = false
      // }
      console.log('radio checked', e.target.value);
    },
    onSwitchChange(e) {
      console.log(e);
      if (e) {
        this.isPolice = true
      } else {
        this.isPolice = false
      }
    },
    handleCancel() {
      this.visible = false
      this.form = {}
    },
    handleOk() {
      if(this.data.supervisResult === 2){
        this.visible = false
      } else {
        putFile(this.data.id).then(ser => {
          if (ser.success){
            this.$message.success('归档成功');
            this.visible = false
            this.$emit('renovate')
          } else {
            this.$message.error('服务器反馈错误');
          }

        }).catch(err => {
          this.$message.error('浏览器反馈错误');
        })
      }

    }
  },
}
</script>
<style lang="less" scoped>
.l-form{
  display: flex;
  align-items: center;
  margin-top: -5px;
}
.display>*{
  margin: 5px;
}
</style>
